<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<title>无标题文档</title>
		<link rel="stylesheet" type="text/css"
			href="${ctx}/js/themes/default/easyui.css">
		<link rel="stylesheet" type="text/css"
			href="${ctx}/js/themes/icon.css">
		<link rel="stylesheet" type="text/css" href="${ctx}/css/demo.css">
		<script type="text/javascript" src="${ctx}/js/jquery-1.8.0.min.js"></script>

		<script type="text/javascript" src="${ctx}/js/jquery.easyui.min.js"></script>
			<script type="text/javascript" src="${ctx}/js/locale/easyui-lang-zh_CN.js"></script>
		<script type="text/javascript" src="${ctx}/js/src/jquery.parser.js"></script>
		<style>
#sel td {
	font: 16px/ 26px "微软正黑体", "华文楷体", Arial, sans-serif, Verdana, Tahoma;
}
</style>

		<script>
	jQuery(function($) {

	});
	jQuery.ajaxSetup( {
		cache : false
	});//ajax不缓存 
    //时间转换
	function formattime(val) {
		var date = new Date(val);
		return date.getFullYear() + '-' + (date.getMonth() + 1) + '-'
				+ date.getDate();
	}
     //提交查询参数
	function searchPurchaseRefund() {
		x = $("form").serializeArray();
		var params = $("#tt2").datagrid("options").queryParams;
		$.each(x, function(i, field) {
				params[field.name] = field.value;
			});
		$("#tt2").datagrid("reload");
	}
	
	function del(){
	  var codes = getSelections();
      if (codes =='') 
        {
		$.messager.alert('提示消息','请选择要删除的数据！', 'info');
	    } 
	  else 
	    {
	    $.messager.confirm('提示消息','确定要删除所选数据吗？',
	      function(r) 
	        {
	        if (r) {
	          $('#processWindow').window('open','aadasdsads');
              $.ajax( {url : '${ctx}/books/del_book.shtml?Codes=' + codes,
					   type : 'post',
					   datatype : 'text',
					   success : function(returnValue) 
					   {
					   if (returnValue)
					     {
						$('#processWindow').window('close');
						$('#roleList').datagrid('reload');
						$('#roleList').datagrid('clearSelections');
					      }
				       }
				 });
					}
						});
		}
	
	}
	$(function() {
		$('#tt2')
				.datagrid(
						{
							title : '',
							iconCls : 'icon-save',
							width : 500,
							height : 550,
							nowrap : false,
							striped : true,
							fitColumns : true,
							fit : true,
							url : '${ctx}/queryUser.shtml',
							sortName : 'uid',
							queryParams : {},
							pageSize : 10,
							sortOrder : 'desc',
							idField : 'uid',
							frozenColumns : [ [ {
								field : 'uid',
								checkbox : true
							}, {
								title : '帐号',
								field : 'uname',
								width : 100,
								sortable : true
							} ] ],
							columns : [ [ {
								field : 'uxm',
								title : '真实姓名',
								width : 120,
								sortable : true
							}, {
								field : 'uqq',
								title : 'qq',
								width : 120,
								sortable : true
							}, {
								field : 'usj',
								title : '手机',
								width : 120,
								sortable : true
							}, {
								field : 'utel',
								title : '电话',
								width : 120,
								sortable : true
							}, {
								field : 'uemail',
								title : '邮箱',
								width : 120,
								sortable : true
							}, {
								field : 'ucity',
								title : '城市',
								width : 120,
								sortable : true
							}, {
								field : 'utime',
								title : '注册时间',
								width : 120,
								formatter : function(val, rec) {
									return formattime(val);
								}
							} ] ],
							pagination : true,
							rownumbers : true,
							toolbar : [
							${sBuffer}
								]
						});
	});
   
    //加载下拉列表
	function loadData() {
		$('#cc').combobox( {
			url : '${ctx}/role/queryZt.shtml?rzt=0',
			valueField : 'rid',
			textField : 'rname'
		});
	}
	  function getSelections() {
            var ids = [];
            var rows = $('#tt2').datagrid('getSelections');
            for (var i = 0; i < rows.length; i++) {
                ids.push(rows[i].uid);
            }
            return ids.join(',');
        }
</script>
	</head>

	<body class="easyui-layout" onload="loadData()">
		<!-- 查询条件-->
		<div data-options="region:'north',border:false"
			style="height: 90px; background: #FFF">
			<form method="post" id="from">
				<table width="100%" height="26%" border="0" id="sel">
					<tr>
						<td width="89" height="29" align="right">
							帐号
						</td>
						<td width="143">
							<input type="text" id="uname" name="uname" />
						</td>
						<td width="99" align="right">
							姓名
						</td>
						<td width="143">
							<input type="text" id="uxm" name="uxm" />
						</td>
						<td width="97" align="right">
							邮件
						</td>
						<td width="143">
							<input type="text" id="uemail" name="uemail" />
						</td>
						<td width="94" align="right">
							手机
						</td>
						<td width="143">
							<input type="text" id="usj" name="usj" />
						</td>
					</tr>
					<tr>
						<td width="89" height="28" align="right">
							证件号码
						</td>
						<td>
							<input type="text" width="143" id="uzjhm" name="uzjhm" />
						</td>
						<td align="right" width="99">
							QQ
						</td>
						<td>
							<input type="text" width="143" id="uqq" name="uqq" />
						</td>
						<td align="right" width="97">
							角色
						</td>
						<td>
							<select id="cc" class="easyui-combobox" name="rid"
								style="width: 130px;">

							</select>
							<!--<select name="select" style="width:120px;">
      <option>一级</option>
      <option>二级</option>
      <option>三级</option>
      <option>四级</option>
    </select>-->
							&nbsp;
						</td>
						<td width="143" align="right">
							&nbsp;
						</td>
						<td>
							&nbsp;
						</td>
					</tr>
				</table>
			</form>
		</div>
		<!-- 结束查询条件-->
		<!--数据列表-->
		<div data-options="region:'center'">
			<table id="tt2">
			</table>
		</div>
		<!--结束数据列表-->
	</body>
</html>
